#ifndef AI_SERVICE_DEATH_RECIPIENT_H
#define AI_SERVICE_DEATH_RECIPIENT_H

#include "iremote_object.h"

namespace OHOS {
namespace AIS {
template <typename T>
class AIServiceDeathRecipient : public IRemoteObject::DeathRecipient
{
public:
    explicit AIServiceDeathRecipient(T &privateData) : privateData_(privateData){};
    virtual ~AIServiceDeathRecipient() = default;
    virtual void OnRemoteDied(const wptr<IRemoteObject> &object)
    {
        privateData_.ProcessDeathObserver(object);
    };

private:
    T &privateData_;
};
} // namespace AIS
} // namespace OHOS
#endif // AI_SERVICE_DEATH_RECIPIENT_H